<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:f="http://xmlns.jcp.org/jsf/core"
      xmlns:p="http://primefaces.org/ui">

    <ui:composition>

        <p:dialog id="LogradourosEditDlg" widgetVar="LogradourosEditDialog" modal="true" resizable="false" appendTo="@(body)" header="#{bundle.EditLogradourosTitle}">
            <h:form id="LogradourosEditForm">
                <h:panelGroup id="display">
                    <p:panelGrid columns="2" rendered="#{logradourosController.selected != null}">
                        <p:outputLabel value="#{bundle.EditLogradourosLabel_id}" for="id" />
                        <p:inputText id="id" value="#{logradourosController.selected.id}" title="#{bundle.EditLogradourosTitle_id}" required="true" requiredMessage="#{bundle.EditLogradourosRequiredMessage_id}"/>
                        <p:outputLabel value="#{bundle.EditLogradourosLabel_rua}" for="rua" />
                        <p:inputText id="rua" value="#{logradourosController.selected.rua}" title="#{bundle.EditLogradourosTitle_rua}" required="true" requiredMessage="#{bundle.EditLogradourosRequiredMessage_rua}"/>
                        <p:outputLabel value="#{bundle.EditLogradourosLabel_bairro}" for="bairro" />
                        <p:inputText id="bairro" value="#{logradourosController.selected.bairro}" title="#{bundle.EditLogradourosTitle_bairro}" required="true" requiredMessage="#{bundle.EditLogradourosRequiredMessage_bairro}"/>
                        <p:outputLabel value="#{bundle.EditLogradourosLabel_cep}" for="cep" />
                        <p:inputText id="cep" value="#{logradourosController.selected.cep}" title="#{bundle.EditLogradourosTitle_cep}" required="true" requiredMessage="#{bundle.EditLogradourosRequiredMessage_cep}"/>
                        <p:outputLabel value="#{bundle.EditLogradourosLabel_cidade}" for="cidade" />
                        <p:selectOneMenu id="cidade" value="#{logradourosController.selected.cidade}" required="true" requiredMessage="#{bundle.EditLogradourosRequiredMessage_cidade}">
                            <f:selectItem itemLabel="#{bundle.SelectOneMessage}"/>
                            <f:selectItems value="#{cidadesController.itemsAvailableSelectOne}"
                                           var="cidadeItem"
                                           itemValue="#{cidadeItem}"/>
                        </p:selectOneMenu>
                    </p:panelGrid>
                    <p:commandButton actionListener="#{logradourosController.update}" value="#{bundle.Save}" update="display,:LogradourosListForm:datalist,:growl" oncomplete="handleSubmit(args, 'LogradourosEditDialog');"/>
                    <p:commandButton value="#{bundle.Cancel}" onclick="LogradourosEditDialog.hide()"/>
                </h:panelGroup>
            </h:form>
        </p:dialog>

    </ui:composition>
</html>
